{extend name="$_admin_base_layout" /} {block name="body"}
<div class="container-fluid" style="padding-top: 10px; background-color: rgb(240, 242, 245);">
    <div class="panel panel-container">
        <div class="panel-body">
            <ul class="nav nav-tabs" style="margin-bottom: 15px;">

                {volist name="config_group" id="data"} {if condition="$key == $group "}
                <li class="active"><a href="{:url('group', array('group'=>$key))}">{$data}配置</a></li>
                {else /}
                <li><a href="{:url('group', array('group'=>$key))}">{$data}配置</a></li>
                {/if} {/volist}
            </ul>

            <form action="" method="post" class="form-horizontal">
                {volist name="data_list" id="config"}
                <div class="form-group">
                    <label class="col-md-2 control-label require">{$config.title}</label>
                    <div class="col-md-4">
                        {switch name="config.type" }
                        {case value="0"}
                        <input name="config[{$config.id}]" type="text" class="form-control"
                               value="{$config.value|default=''}">
                        {/case}
                        {case value="1"}
                        <input name="config[{$config.id}]" type="text" class="form-control"
                               value="{$config.value|default=''}">
                        {/case}
                        {case value="2"}
                        <input name="config[{$config.id}]" type="text" class="form-control"
                               value="{$config.value|default=''}">
                        {/case}
                        {case value="3"}
                        <textarea name="config[{$config.id}]" class="form-control" rows="3">{$config.value}</textarea>
                        {/case}
                        {case value="4"}
                        <select name="config[{$config.id}]" class="form-control">
                            {volist name=":parse_config_attr($config['extra'])" id="extra"}
                            {if condition="$key == $config['value'] "}
                            <option value="{$key}" selected="selected">{$extra}</option>
                            {else /}
                            <option value="{$key}">{$extra}</option>
                            {/if}
                            {/volist}
                        </select>
                        {/case}
                        {case value="5"}
                        <input name="config[{$config.id}]" type="number" class="form-control"
                               value="{$config.value|default=''}">
                        {/case}
                        {case value="6"}
                        <input name="config[{$config.id}]" type="text" class="form-control form-date"
                               value="{$config.value|default=''}">
                        {/case}
                        {case value="7"}
                        <input name="config[{$config.id}]" type="text" class="form-control form-datetime"
                               value="{$config.value|default=''}">
                        {/case}
                        {default /}
                        {/switch}
                    </div>
                    <div class="col-md-6">
                        <div class="help-block">{$config.remark}</div>
                    </div>
                </div>
                {/volist}
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <button class="btn btn-primary ajax-post" type="submit" data-href="form-horizontal">
                            <i class="icon icon-save"></i> 保存
                        </button>

                    </div>
                </div>
            </form>

        </div>
    </div>
</div>
{/block}
{block name="style"}
<link href="__STATIC__/zui/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet">
{/block}
{block name="script"}
<script src="__STATIC__/zui/lib/datetimepicker/datetimepicker.min.js"></script>
<script>
    $(function () {
        // 仅选择日期
        $(".form-date").datetimepicker({
            language: "zh-CN",
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            minView: 2,
            forceParse: 0,
            format: "yyyy-mm-dd"
        });
        $(".form-datetime").datetimepicker({
            language: "zh-CN",
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            showMeridian: 1,
            format: "yyyy-mm-dd hh:ii"
        });
    });
</script>
{/block}
